<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/konva.js"></script>
</head>
<body>
里面有canvas了
<div id="containerId"></div>
<script>
    //1.创建舞台
    var stage = new Konva.Stage({
        width:window.innerWidth,
        height:window.innerHeight,
        container:'containerId'
    });
    //2.创建层
    var layer = new Konva.Layer();
    //将层添加舞台中
    stage.add(layer);

    //3.创建组
    //组中的x和y值表示坐标原点
    var group = new Konva.Group({
        x:0,
        y:0
    });
    layer.add(group);

    //4.创建演员
    var rectangle = new Konva.Rect({
        x:100,
        y:100,
        width:100,
        height:200,
        fill:'red',
        stroke:'blue',
        strokeWidth:10,
        scaleX:2,
        scaleY:2,
        rotation:-40,
        dash: [5,6],
        draggable: true
    });
/*
* var innerRadius = this.innerRadius(),
                outerRadius = this.outerRadius(),
                numPoints = this.numPoints();

* */
    var star = new Konva.Star({
        x:200,
        y:200,
        numPoints:5,
        innerRadius:50,
        outerRadius:100,
        fill: 'red',
        stroke: 'gold',
        strokeWidth: 4,
        draggable : true
    });
    //group.add(rectangle);
    group.add(star);
    group.draw();
</script>
</body>
</html>